#!/usr/bin/env bash
set -e


#    echo "Enabling repositories"
#line=$(sudo cat /etc/pacman.conf |grep '\#\[libre-multilib\]')
#if [ $? -eq 0 ]
 #  then
#   sudo sh -c 'echo "[libre-multilib]" >> /etc/pacman.conf && echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
#fi
#line=$(sudo cat /etc/pacman.conf | grep '\#\[multilib\]')
#if [ $? -eq 0 ]
#   then
#   sudo sh -c 'echo "[multilib]" >> /etc/pacman.conf && echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
#fi
#line=$(sudo cat /etc/pacman.conf | grep '\#\[pcr')
#if [ $? -eq 0 ]
#   then
#   sudo sh -c 'echo "[pcr]" >> /etc/pacman.conf && echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
#fi

#echo "Updating parabola mirrors to https only"
#sudo pacman -Syy && sudo pacman -S --noconfirm wget
#sudo wget  https://www.parabola.nu/mirrorlist/all/https
#sudo sh -c 'cat https  | cut -c2- > /etc/pacman.d/mirrorlist'
#rm -f https

#pacman -Qett | cut -d' ' -f1 > pkglist.parabola
echo "Installing packages from parabola repositories..."
sudo pacman -Syy && sudo pacman -S $(<pkglist.parabola)

echo "Changing shell to zsh"
chsh -s /bin/zsh

echo "Installing emacsfont"
sudo cp -r fonts/emacsicon /usr/share/fonts/
fc-cache
